<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改订单信息')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-edit" th:object="${order}">
            <input name="cards" th:field="*{cards}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">卡密信息，仅卡密订单返回：</label>
                <div class="col-sm-8">
                    <input name="cards" th:field="*{cards}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">运营商流水号：</label>
                <div class="col-sm-8">
                    <input name="operatorSerialNumber" th:field="*{operatorSerialNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单类型(1-话费 2-流量 3-卡密 4-直充)：</label>
                <div class="col-sm-8">
                    <select name="orderType" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">计费方式：</label>
                <div class="col-sm-8">
                    <select name="type" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">充值服：</label>
                <div class="col-sm-8">
                    <input name="server" th:field="*{server}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">充值区：</label>
                <div class="col-sm-8">
                    <input name="area" th:field="*{area}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单完成时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="finishTime" th:value="${#dates.format(order.finishTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单状态：</label>
                <div class="col-sm-8">
                    <input name="orderState" th:field="*{orderState}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">交易单价：</label>
                <div class="col-sm-8">
                    <input name="orderPrice" th:field="*{orderPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">购买数量：</label>
                <div class="col-sm-8">
                    <input name="buyNum" th:field="*{buyNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">外部订单ID：</label>
                <div class="col-sm-8">
                    <input name="customerOrderNo" th:field="*{customerOrderNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">充值账号：</label>
                <div class="col-sm-8">
                    <input name="chargeAccount" th:field="*{chargeAccount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品名称：</label>
                <div class="col-sm-8">
                    <input name="productName" th:field="*{productName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品Id：</label>
                <div class="col-sm-8">
                    <input name="productId" th:field="*{productId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单编号：</label>
                <div class="col-sm-8">
                    <input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script type="text/javascript">
        var prefix = ctx + "fulu/order";
        $("#form-order-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
            }
        }

        $("input[name='finishTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>